package com.example.tool.bean.business.wechat;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.text.SimpleDateFormat;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class GetDocItem {
    @JsonProperty("docid")
    private String docid;
    @JsonProperty("doc_name")
    private String docName;
    @JsonProperty("create_time")
    private Long createTime;         // 文档访问链接
    @JsonProperty("modify_time")
    private Long modifyTime;       // 文档唯一ID
    @JsonProperty("doc_type")
    private String docType;       // 文档唯一ID
//    private String createTimeStr;
//    private String modifyTimeStr;
    private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public String getModifyTimeStr() {
        if (modifyTime!=null){
          return   sdf.format(new Date(modifyTime));
        }
        return "";
    }

    public String getCreateTimeStr() {
        if (createTime!=null){
            return   sdf.format(new Date(createTime));
        }
        return "";
    }
}